<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('user/index_sub')}">二级管理员列表</a></li>
			<li><a href="{:U('user/add_sub')}">二级管理员添加</a></li>
			<li class="active"><a>编辑管理员</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('User/edit_post')}">
			<fieldset>
				<div class="control-group">
					<label class="control-label">{:L('USERNAME')}</label>
					<div class="controls">
						<input type="text" name="user_login" value="{$user_login}">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">{:L('PASSWORD')}</label>
					<div class="controls">
						<input type="password" name="user_pass" value="" placeholder="******">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">姓名</label>
					<div class="controls">
						<input type="text" name="user_nicename" value="{$user_nicename}">
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">手机号</label>
					<div class="controls">
						<input type="text" name="user_phone" value="{$user_phone}">
					</div>
				</div>
				<!--<div class="control-group">-->
					<!--<label class="control-label">{:L('EMAIL')}</label>-->
					<!--<div class="controls">-->
						<!--<input type="text" name="user_email" value="{$user_email}">-->
					<!--</div>-->
				<!--</div>-->
				<div class="control-group">
					<label class="control-label">{:L('ROLE')}</label>
					<div class="controls">
						<foreach name="roles" item="vo">
							<label class="checkbox inline">
								<input value="{$vo.id}" type="radio" name="role_id" onchange="change_role()" <if condition="$model == $vo['id']">checked="checked"</if>>{$vo.name}
							</label>
						</foreach>
					</div>
				</div>
			</fieldset>
			<div class="form-actions">
				<input type="hidden" name="id" value="{$id}" />
				<input type="hidden" name="model" value="{$model}"/>
				<button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
				<a class="btn" href="{:U('user/index_sub')}">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		function change_role(){
			var role_id = $("input[name='role_id']:checked").val();
			console.log(role_id);
			$("input[name='model']").val(role_id);
		}
	</script>
</body>
</html>